<template>
  <div>
    <my-header></my-header>
    <div style="height: 5300px">
      <div class="bc1">
        <img src="/hubanner1.jpg" alt="" />
      </div>
      <div class="bc2">
        <img class="bcg" src="/bor1.png" alt="" />
        <div class="xzlb">
          <div class="yxhd">
            <ul>
              <li><img src="/home.png" /></li>
              <li><div class="gun">|</div></li>
              <li><span>研学互动</span></li>
            </ul>
          </div>
          <div class="xllb">
            <img src="/home2.png" alt="" />
            <span>动物课堂</span>
            <div class="xllb2">动物互动</div>
          </div>
        </div>
        <!-- 小爪子 -->
        <div class="zhuazi">
          <img src="/zhua.png" />
          <span>探索趣味动物百科</span>
        </div>
        <!-- 内容卡片 -->
        <div v-if="datas" style="width: 1200px">
          <div
            class="cards"
            v-for="{title, age, content, location, starDate, id} in datas"
            :key="id"
          >
            <div class="cards_img">
              <div v-for="(item, i) in datas[id - 1].image1" :key="i">
                <img class="imgs" :src="`http://localhost:8080/${item}`" />
              </div>
            </div>
            <div class="cards_word">
              <h4 class="tit">{{ title }}</h4>
              <div class="xian"></div>
              <div class="date">
                <img src="/zhong.png" alt="" />
                <p>{{ starDate }}</p>
              </div>

              <div class="lct">
                <img src="/dingwei.png" />
                <p>{{ location }}</p>
              </div>

              <div class="tag_a">
                <span
                  class="tag"
                  v-for="(items, a) in datas[id - 1].tag1"
                  :key="a"
                >
                  {{ items }}
                </span>
              </div>
              <div class="cont">
                <span>{{ content }}</span>
              </div>
              <div class="ages">{{ age }}</div>
            </div>
          </div>
        </div>
      </div>
      <div class="word">
        <img src="/image/ntitle3.png" alt="" />
        <p>来探索你不知道的小秘密吧~</p>
      </div>
    </div>
    <my-footer></my-footer>
  </div>
</template>

<script>
  import MyHeader from "@/components/MyHeader.vue";
  import MyFooter from "@/components/MyFooter.vue";
  export default {
    components: {MyHeader, MyFooter},
    data() {
      return {
        datas: [],
      };
    },
    mounted() {
      this.getData();
    },
    methods: {
      getData() {
        this.axios.get("Research").then(res => {
          for (let i = 0; i < res.data.result.length; i++) {
            console.log(res);
            this.datas = res.data.result;
            this.datas[i].image1 = this.datas[i].image1.split(",");
            this.datas[i].tag1 = this.datas[i].tag1.split(",");
          }
        });
      },
    },
  };
</script>

<style>
  * {
    margin: 0;
    padding: 0;
  }
  .el-main {
    height: 100vh;
    margin: 0;
    padding: 0;
    position: relative;
  }
  .ages {
    background-color: #a5651a;
    color: #ffffda;
    font-size: 14px;
    height: 40px;
    width: 200px;
    text-align: center;
    line-height: 40px;
    border-radius: 10px;
  }
  .cont {
    margin-bottom: 10px;
  }
  .cont span {
    font-size: 14px;
  }
  .tag_a {
    margin: 8px 0 20px 0;
  }
  .tag {
    background-color: #e5e5e5;
    padding: 6px 20px;
    margin-right: 10px;
    font-size: 12px;
    border-radius: 20px;
  }

  .lct {
    display: flex;
    margin-top: 8px;
  }
  .lct p {
    font-size: 12px;
  }
  .lct img {
    width: 20px;
    height: 20px;
  }
  .date {
    margin-top: 30px;
    display: flex;
  }
  .date img {
    width: 18px;
    height: 18px;
  }
  .date p {
    font-size: 14px;
  }
  .xian {
    border-bottom: 2px solid #356a0b;
    width: 55px;
  }
  .tit {
    font-size: 28px;
    color: #353535;
    margin-bottom: 20px;
  }
  .cards {
    background-color: white;
    border-radius: 20px;
    height: 454px;
    width: 1160px;
    margin-top: 6vh;
    margin-left: 12vw;
    display: flex;
  }
  .cards_img {
    width: 580px;
    height: 100%;
    overflow: hidden;
  }
  .imgs {
    width: 100%;
    height: 454px;
    border-radius: 20px 0 0 20px;
  }
  .cards_word {
    width: 580px;
    padding: 50px 60px 60px 60px;
  }
  .zhuazi {
    width: 100vw;
    text-align: center;
    margin-top: 1vh;
  }
  .zhuazi img {
    vertical-align: bottom;
    margin-right: 1vw;
  }
  .zhuazi span {
    font-size: 42px;
    font-weight: bold;
    color: #2b4c1d;
  }
  .xzlb {
    display: flex;
    margin-left: 11vh;
    margin-top: -13vh;
    height: 6vh;
    line-height: 6vh;
  }
  .xllb2 {
    font-size: 13px;
    color: #337ab7;
    border-radius: 6px;
    margin-top: 0.5vh;
    line-height: 4vh;
    text-align: center;
    height: 4vh;
    width: 8vw;
    background: white;
    border: 1px solid #cccccc;
    margin-left: 1vw;
    display: none;
  }
  .xllb img {
    vertical-align: middle;
    width: 3vh;
    height: 3vh;
    margin: 0 1vw 0 1vw;
  }
  .yxhd {
    width: 7vw;
  }
  .yxhd > ul {
    display: flex;
    list-style: none;
    justify-content: space-evenly;
  }
  .yxhd .gun {
    color: #a7a6a4;
  }
  .yxhd > ul > li > img {
    width: 1vw;
    height: 1.5vh;
  }
  .word {
    position: absolute;
    width: 444px;
    height: 183px;
    top: 12vh;
    left: 11vh;
    z-index: 2;
  }
  .word p {
    font-size: 33px;
    color: white;
    margin-top: 10px;
    display: block;
  }
  .bc1 {
    position: relative;
    width: 100vw;
    /* height: 41vh; */
  }
  .bc1 img {
    width: 100%;
    height: 100%;
  }
  .bc2 {
    width: 100vw;
    height: 20vh;
  }
  .bc2 .bcg {
    width: 100%;
  }
  .bc2 {
    margin-top: -2vh;
    background-image: url("../../public/wen1.jpg");
    width: 100vw;
    /* height: 100vw; */
  }
</style>
